<%@page import="com.mysql.fabric.xmlrpc.base.Param"%>
<%@ page language="java" import="java.util.*,com.enterprise.daoImpl.*,com.enterprise.domain.*" pageEncoding="UTF-8"%>
<script language="JavaScript" type="text/JavaScript">
function checkSmall()
{
  if (document.form2.BigClassName.value=="")
  {
    alert("请先添加大类名称！");
	document.form1.BigClassName.focus();
	return false;
  }

  if (document.form2.SmallClassName.value=="")
  {
    alert("小类名称不能为空！");
	document.form2.SmallClassName.focus();
	return false;
  }
}
</script>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td align="center" valign="top"> <table width="80%" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td align="center" valign="top"> <br> <strong>新 闻 类 别 设 置</strong> <br> 
            <form name="form2" method="post" action="node-insert.action" onsubmit="return checkSmall()">
              <table width="350" border="0" align="center" cellpadding="0" cellspacing="2" class="border">
                <tr bgcolor="#A4B6D7" class="title"> 
                  <td height="25" colspan="2" align="center"><strong>添加小类</strong></td>
                </tr>
                <tr class="tdbg"> 
                  <td width="126" height="22" bgcolor="#C0C0C0"><strong>所属大类：</strong></td>
                  <td width="218" bgcolor="#E3E3E3"> 
                  <select name="parentId">
                   <%NodeDaoImpl nodeDaoImpl=new NodeDaoImpl();
              	List<Node> list=nodeDaoImpl.getNodes(-1);
					              
               %>
                  <% if(list!=null&&list.size()>0)
               	{
               	
               		for(Node node:list)
               		
               		{
               			
               %>
             
               
 					<option value="<%=node.getId() %>"   <%if(Integer.parseInt(pageContext.getRequest().getParameter("parentId"))==node.getId()){%>selected='selected'<%} %> >
 								<%=node.getClassName() %>
 				</option>
 					<%}} %>																
    		
                    </select></td>
                </tr>
                
                <tr class="tdbg"> 
                  <td width="126" height="22" bgcolor="#C0C0C0"><strong>小类名称：</strong></td>
                  <td bgcolor="#E3E3E3"> <input name="className" type="text" size="20" maxlength="30"></td>
                </tr>
                <tr class="tdbg"> 
                  <td height="22" align="center" bgcolor="#C0C0C0">&nbsp; </td>
                  <td height="22" align="center" bgcolor="#E3E3E3"> <div align="left"> 
                      <input  type="hidden" id="Action3" value="Add">
                      <input  type="submit" value=" 添 加 ">
                    </div></td>
                </tr>
              </table>
            </form></td>
        </tr>
      </table>
 <%--      <%
end if
%> --%> <br> </td>
  </tr>
</table>
